import request from '@/utils/request'

// 查询菜单列表信息
export function list(query) {
  return request({
    url: '/sys/menu/listByEnterprise',
    method: 'post',
    params: query
  })
}
// 查询已分配菜单
export function assignedMenu(enterpriseId, subCompany) {
  const data = {
    'enterpriseId': enterpriseId,
    'subCompany': subCompany
  }
  return request({
    url: '/sys/enterprise/assignedMenu',
    method: 'post',
    params: data
  })
}

// 通过菜单id 查询菜单信息
export function selectMenuDetail(menuId, enterpriseId, subCompany) {
  return request({
    url: '/sys/menu/selectMenuDetail/' + menuId + '/' + enterpriseId + '/' + subCompany,
    method: 'get'
  })
}

// 保存企业菜单时间修改
export function addOrupdateEnterpriseMenu(data) {
  return request({
    url: '/sys/enterprise/updateEnterpriseMenu',
    method: 'post',
    data,
    headers: { 'content-type': 'application/json' }
  })
}
